<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>用户注册页面</title>
<script type="text/javascript" src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
		<script type="text/javascript">
			$(function () {
				$("#register_button").click(function (){
					var user_name = $("#user_name").val();
					var user_pwd = $("#user_pwd").val();
					var user_con_pwd = $("#user_con_pwd").val();
					if(user_name == '' || user_pwd == '' ){
						alert("用户名或密码不为空");
					}else if(user_con_pwd != user_pwd){
						alert("确认密码不正确！");
					}else{
						$("#register_form").submit();
					}
					/* var admin = new Object();
					user.userName = $("#admin_name").val();
					user.userPwd = $("#admin_pwd").val();
					if(admin.adminName == ""){
						alert("用户名不为空");
					}else if(admin.adminPwd == ""){
						alert("密码不为空");
					}else{
						jQuery.ajax({
							async : true,
							data : JSON.stringify(admin),
							dataType : "json",
							contentType:"application/json;charset=utf-8",
							success : function (result) {
							
							 var obj = JSON.parse(result);
								 if(obj.code){
									window.location.href = "http://localhost:8080/foodie/admin_login/index";//登录成功后，跳转到主页
								}else{
									alert(obj.data);
								}  	
							},
							type : "POST",
							url : "http://localhost:8080/foodie/admin_login/login"
						}); 
					}; */
				});
			})
		</script>
</head>
<body>
我是前台用户注册页面

<h2 align="center">前台用户注册</h2>
	<form action="http://localhost:8080/foodie/user_login/register" method="post" id="register_form" accept-charset="UTF-8" onsubmit="document.charset='utf-8'">
		<table border="0" align="center">
			<tr>
				<th>用户名</th>
				<td><input type="text" name="userName" id="user_name" /></td>
			</tr>
			<tr>
				<th>密码</th>
				<td><input type="password" name="userPwd" id = "user_pwd" /></td>
			</tr>
			<tr>
				<th>确认密码</th>
				<td><input type="password" name="userConPwd" id = "user_con_pwd" /></td>
			</tr>
			<tr>
				<td colspan="2" align="center"><button type="button" id="register_button">注册</button></td>
			</tr>
		</table>
		
	</form>
</body>
</html>